Skip to content

Fix implicit nullable type to avoid PHP 8.4 warnings#247

Merged
dbu merged 4 commits into
php-http:2.xfrom
eiriksm:fix/nullable
Sep 23, 2024
Merged

Fix implicit nullable type to avoid PHP 8.4 warnings#247
dbu merged 4 commits into
php-http:2.xfrom
eiriksm:fix/nullable

Conversation

@eiriksm

@eiriksm eiriksm commented Sep 23, 2024

Copy link
Copy Markdown
Contributor
Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Related tickets fixes #X, partially #Y, mentioned in #Z
Documentation if this is a new feature, link to pull request in https://github.com/php-http/documentation that adds relevant documentation
License MIT

What's in this PR?

This PR makes the implicit nullable type explicit. Using implicit nullable types has been deprecated, and will emit deprecation warnings in PHP 8.4

Why?

To avoid getting deprecation warnings in PHP 8.4

Checklist

  • Updated CHANGELOG.md to describe BC breaks / deprecations | new feature | bugfix
  • Documentation pull request created (if not simply a bugfix)

@GrahamCampbell

Copy link
Copy Markdown
Contributor

Can we add PHP 8.4 to the CI, too?

@eiriksm

eiriksm commented Sep 23, 2024

Copy link
Copy Markdown
Contributor Author

Can we add PHP 8.4 to the CI, too?

done 🤓

@GrahamCampbell

Copy link
Copy Markdown
Contributor

Fixes similar to php-http/httplug#176 are needed.

@eiriksm

eiriksm commented Sep 23, 2024

Copy link
Copy Markdown
Contributor Author

added the "emulate php 8.3" part, but not sure which tweak is needed to fix phpcs. Which by the way should probably be a separate PR, as it does not relate to the changes in this PR

@GrahamCampbell

Copy link
Copy Markdown
Contributor

The tweak is needed to get it to pass, because the symfony ruleset has changed and the php-cs-fixer version is not pinned.

@dbu

dbu commented Sep 23, 2024

Copy link
Copy Markdown
Contributor

i updated the cs fixer and apply the fixes in #248. that includes the ? for nullable parameters.

can you please rebase on the 2.x branch? that should make the cs fixer green.

@eiriksm

eiriksm commented Sep 23, 2024

Copy link
Copy Markdown
Contributor Author

@dbu dbu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks a lot!

@dbu
dbu merged commit 83263d4 into php-http:2.x Sep 23, 2024
@eiriksm
eiriksm deleted the fix/nullable branch September 23, 2024 21:48
@eiriksm

eiriksm commented Sep 23, 2024

Copy link
Copy Markdown
Contributor Author

amazing. thank you so much for being so responsive 😄

Any chance we could also cut a new release with this change? 🤓

@dbu

dbu commented Sep 24, 2024

Copy link
Copy Markdown
Contributor

thanks for contributing. i tagged the release: https://github.com/php-http/client-common/releases/tag/2.7.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants